package com.fengyi.homefurnish.service.impl;

import com.fengyi.homefurnish.mapper.GoodsBasicInfoMapper;
import com.fengyi.homefurnish.pojo.*;
import com.fengyi.homefurnish.service.GoodsBasicInfoService;
import com.fengyi.homefurnish.utils.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsBasicInfoServiceImpl implements GoodsBasicInfoService {

    @Autowired
    private GoodsBasicInfoMapper goodsBasicInfoMapper;

    @Override
    public Pager<GoodsBasicInfo> getGoodsSearch(Integer offset, Integer limit) {
        Pager<GoodsBasicInfo> goods = new Pager<GoodsBasicInfo>();
        goods.setRows(goodsBasicInfoMapper.search(offset,limit));
        goods.setTotal(goodsBasicInfoMapper.total());
        return goods;
    }

    @Override
    public void updateGoodsState(GoodsBasicInfo goodsBasicInfo) {
        goodsBasicInfoMapper.updateGoodsState(goodsBasicInfo);
    }

    @Override
    public GoodsBasicInfo GetSearch(Integer goodsBasicInfoId) {
        return goodsBasicInfoMapper.GetSearch(goodsBasicInfoId);
    }

    @Override
    public List<ProSeries> proseries() {
        return goodsBasicInfoMapper.proseries1();
    }

    @Override
    public List<ProAttrName> proAttrName() {
        return goodsBasicInfoMapper.proAttrName();
    }

    @Override
    public List<GoodsPriceType> GetGoodsPriceType() {
        return goodsBasicInfoMapper.GetGoodsPriceType();
    }

    @Override
    public List<GoodsPictureManager> GetGoodsPictureManager(Integer goodsBasicInfoId) {
        return goodsBasicInfoMapper.GetGoodsPictureManager(goodsBasicInfoId);
    }
}
